package com.xiyi.shouxin.view.pojo;

import java.util.List;

import com.xiyi.shouxin.entity.admin.Role;

import lombok.Getter;

@Getter
public class RoleView extends Role {
    private List<MenuView> menus;

    public RoleView(Role role, List<MenuView> menus) {
        if (role!=null) {
            this.setId(role.getId());
            this.setRoleName(role.getRoleName());
        }
        this.menus = menus;
    }

    public Role toRole() {
        Role role = new Role();
        role.setId(this.getId());
        role.setRoleName(this.getRoleName());
        return role;
    }
}
